<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-card>
      <a-table
        bordered
        size="middle"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="false"
        :loading="loading"
        rowKey="id"
        class="j-table-force-nowrap"
      />
    </a-card>
  </j-modal>
</template>

<script>

import { postAction } from '@/api/manage'
export default {
  name: 'AuditInfo',
  components: {
  },
  data () {
    return {
      title:'',
      width:800,
      visible: false,
      disableSubmit: true,
      dataSource: [],
      loading:false,

      columns: [
        {
          title: '#',
          dataIndex: '',
          key:'rowIndex',
          width:60,
          align:"center",
          customRender:function (t,r,index) {
            return parseInt(index)+1;
          }
        },
        {
          title:'审核内容类型',
          align:"center",
          dataIndex: 'reviewType',
          customRender:function (t,r,index) {
            if(t=='1'){
              return '文本';
            }else if(t=='2'){
              return '图片';
            }else if(t=='3'){
              return '音频';
            }else if(t=='4'){
              return '视频';
            }
            return t;
          }
        },
        {
          title:'审核详情',
          align:"center",
          dataIndex: 'riskDesc'
        },
        {
          title:'审核时间',
          align:"center",
          dataIndex: 'createTime'
        },]
    }
  },
  methods: {
    close () {
      this.$emit('close');
      this.visible = false;
    },
    handleCancel () {
      this.close()
    },

    //审核
    getAuditInfo(bizId,bizType){
      this.loading = true;
      postAction('/system/contentReview/queryInfoByBizId', {bizId: bizId,bizType:bizType}).then(({success, result, message}) => {
        if (success) {
          if(result){
            this.dataSource=result;
          }else{
            this.$message.warning("未有违规记录");
            this.close();
          }
        } else {
          this.$message.warning(message)
        }
      }).finally(() => this.loading = false)
    }
  }
}
</script>

<style scoped>

</style>